package com.openlogic.datasource.api.dto;

import java.io.Serializable;
import java.util.List;

import org.noear.solon.validation.annotation.Min;
import org.noear.solon.validation.annotation.NotBlank;
import org.noear.solon.validation.annotation.NotNull;

/**
* @ClassName: SqlConsoleDto
* @Description: SQL控制台数据交互Dto
* @author weiyongpeng
* @date 2024年11月24日 上午10:10:36
 */
public class SqlConsoleDto implements Serializable {

    private static final long serialVersionUID=1L;

    /**
     * 当前时间戳
     */
	@NotBlank(message = "时间戳不能为空"/* , groups = {V_A_E.class} */)
    private String sqlKey;

    /**
     * 数据源
     */
    @NotBlank(message = "数据源不能为空")
    private String sourceId;

    /**
     * SQL文本
     */
    @NotBlank(message = "SQL不能为空")
    private String sqlText;
    
    /**
     * 参数
     */
    private List<InParameter> param;
    
    /**
     * 每页数据条数
     */
    private Integer maxCount;
    
    /**
     * 当前页
     */
    @Min(value = 1)
    private Integer currentPage;
    
    private String tableName;
    
    private Integer page;
    
    private Integer pageSize;
    
	public SqlConsoleDto() {
		super();
	}

	public SqlConsoleDto(String sqlKey,String sourceId, String sqlText, String tableName, Integer page, Integer pageSize) {
		this.sqlKey = sqlKey;
		this.sourceId = sourceId;
		this.sqlText = sqlText;
		this.tableName = tableName;
		this.page = page;
		this.pageSize = pageSize;
	}

	public String getSqlKey() {
		return sqlKey;
	}

	public void setSqlKey(String sqlKey) {
		this.sqlKey = sqlKey;
	}

	public String getSourceId() {
		return sourceId;
	}

	public void setSourceId(String sourceId) {
		this.sourceId = sourceId;
	}

	public String getSqlText() {
		return sqlText;
	}

	public void setSqlText(String sqlText) {
		this.sqlText = sqlText;
	}

	public List<InParameter> getParam() {
		return param;
	}

	public void setParam(List<InParameter> param) {
		this.param = param;
	}
	
	public Integer getMaxCount() {
		return maxCount;
	}

	public void setMaxCount(Integer maxCount) {
		this.maxCount = maxCount;
	}

	public Integer getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(Integer currentPage) {
		this.currentPage = currentPage;
	}
    
	public String getTableName() {
		return tableName;
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
	}
	
	public Integer getPage() {
		return page;
	}

	public Integer getPageSize() {
		return pageSize;
	}

	public static class InParameter {
		/**
		 * 键
		 */
		@NotNull(message = "参数键不能为空")
        private String key;
        /**
         * 类型
         */
        @NotNull(message = "参数类型不能为空")
        private String type;
        /**
         * 键中文描述
         */
        private String label;
        /**
         * 值
         */
        private Object value = "";
		public String getKey() {
			return key;
		}
		public void setKey(String key) {
			this.key = key;
		}
		public String getType() {
			return type;
		}
		public void setType(String type) {
			this.type = type;
		}
		public String getLabel() {
			return label;
		}
		public void setLabel(String label) {
			this.label = label;
		}
		public Object getValue() {
			return value;
		}
		public void setValue(Object value) {
			this.value = value;
		}

    }
}
